home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / macros / Emacs / Emacs_Exchange_Point_and_Mark.bsh < prev    next >
Text File  |  2013-07-28  |  454b  |  22 lines

  1. /**
  2.  * Emulate GNU Emacs's "exchange-point-and-mark" capability.
  3.  * Does NOT use jEdit markers.
  4.  */
  5. source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
  6.  
  7. void emacsExchangePointAndMark()
  8. {
  9.     int mark = getMark (buffer);
  10.     if (mark == -1)
  11.     {
  12.         beep();
  13.         return;
  14.     }
  15.     int point = textArea.getCaretPosition();
  16.     setMark (buffer, point);
  17.     textArea.setCaretPosition (mark);
  18. }
  19.  
  20. emacsExchangePointAndMark();
  21.  
  22.